package com.biubiu.biubiuexam.sql.repository;

import com.biubiu.biubiuexam.sql.entity.Clazz;
import com.biubiu.biubiuexam.sql.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * The interface Clazz repository.
 */
public interface ClazzRepository extends JpaRepository<Clazz, Long> {
    /**
     * Find by name clazz.
     *
     * @param name the name
     * @return the clazz
     */
    Clazz findByName(String name);

    /**
     * Find all by teacher list.
     *
     * @param teacher the teacher
     * @return the list
     */
    List<Clazz> findAllByTeacher(User teacher);

    /**
     * Find by code clazz.
     *
     * @param code the code
     * @return the clazz
     */
    Clazz findByCode(String code);

}
